home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWDebug / Include / FWTraceT.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  1.5 KB  |  60 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWTraceT.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #if defined(FW_DEBUG) &&  !defined(FWTRACET_H)
  13. #define FWTRACET_H
  14.  
  15. #ifndef   FWPRITAS_H
  16. #include "FWPriTas.h"
  17. #endif
  18.  
  19. #ifndef   FWSTRACE_H
  20. #include "FWSTrace.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. // CLASS FW_CPrivTraceTaskGlobals
  25. //========================================================================================
  26.  
  27. class FW_CPrivTraceTaskGlobals
  28. {
  29.  
  30. public:
  31.  
  32.     static void Initialize(FW_SPrivTraceGlobals& globals);
  33.     static void Terminate();
  34.  
  35.     static FW_SPrivTraceGlobals&        GetTraceGlobals();
  36.  
  37. private:
  38.  
  39.     enum {kTraceTaskGlobalsOffset = 6};
  40.     
  41.     ~FW_CPrivTraceTaskGlobals();
  42.     FW_CPrivTraceTaskGlobals();
  43.  
  44. };
  45.  
  46. //----------------------------------------------------------------------------------------
  47. //    FW_CPrivTraceTaskGlobals::GetTraceGlobals
  48. //----------------------------------------------------------------------------------------
  49.  
  50. inline FW_SPrivTraceGlobals& FW_CPrivTraceTaskGlobals::GetTraceGlobals()
  51. {
  52.     FW_SPrivTraceGlobals *globals = (FW_SPrivTraceGlobals*)
  53.                 FW_CPrivTaskGlobals::GetTaskGlobals(kTraceTaskGlobalsOffset);
  54.     if (globals->gDebugConsole == 0)
  55.         Initialize(*globals);
  56.     return *globals;
  57. }
  58.  
  59. #endif
  60.